package net.kazed.nextaction.database.serialize;

import net.kazed.nextaction.database.GtdContext;

public class ContextXmlSerializer {
   
   private XmlWriter writer;

   /**
    * Constructor.
    * @param writer XML writer.
    */
   public ContextXmlSerializer(XmlWriter writer) {
      super();
      this.writer = writer;
   }

   /**
    * Serialize context.
    * @param context Serialize this context.
    */
   public void serialize(GtdContext context) {
      writer.startElement("context");
      writer.addElement("id", context.getId());
      writer.addElement("parentId", context.getParentContextId());
      writer.addElement("name", context.getName());
      writer.endElement();
   }

}
